package com.itheima.tliasmanagement.controller;

import com.itheima.tliasmanagement.service.ReportService;
import com.itheima.tliasmanagement.vo.EmpJobDataVo;
import com.itheima.tliasmanagement.vo.NameValueVo;
import com.itheima.tliasmanagement.vo.Result2;
import com.itheima.tliasmanagement.vo.StudentCountDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 报表接口
 * */
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    /**
     * 统计各个职位的员工人数
     * */
    @GetMapping("/empJobData")
    public Result2<EmpJobDataVo> empJobData(){
        EmpJobDataVo vo = reportService.empJobData();
        return Result2.ok(vo);
    }

    /**
     *  统计员工性别信息
     * */
    @GetMapping("/empGenderData")
    public Result2<List<NameValueVo>> empGenderData(){
        List<NameValueVo> voList = reportService.empGenderData();
        return Result2.ok(voList);
    }

    /**
     * 班级人数统计
     * */
    @GetMapping("/studentCountData")
    public Result2<StudentCountDataVo> studentCountData(){
        StudentCountDataVo vo = reportService.studentCountData();
        return Result2.ok(vo);
    }

    /**
     *
     * */
    @GetMapping("/studentDegreeData")
    public Result2<List<NameValueVo>> studentDegreeData(){
        List<NameValueVo> list = reportService.studentDegreeData();
        return Result2.ok(list);
    }


}
